const panel = this.pageObj.getApiWidgetByAliasName('event-panel')?.widgetObj
// 获取演练进度
const process = this.pageObj.getVariables().find(v => v.name === 'whetherProcess')?.value || 0
const queryManage = this.pageObj.getApiWidgetByAliasName('queryManage')?.widgetObj
const searchText = this.pageObj.getVariables().find(v => v.name === 'event_search')?.value || ''
console.log('切换', $event)
this.getApiPage().setVariables([{name: 'panelType', value: $event}])

/**
 * 重新渲染
 *
 * @param data
 */
function setData (data) {
    const expand = panel.getExpandSelected()
    expand.clear()
    panel.setData([{ data }])
    panel.render()
}

if (+$event === 0) {
    // 关闭分页
    panel._option.panel_config.openPage = false
    // 请求最新
    queryManage.queryDrillNews(+process, searchText).then(res => {
        setData (res)
    })
} else {
    // 打开分页
    panel._option.panel_config.openPage = true
    // 请求区域、分类、分级
    queryManage.queryDrillGroup(+$event, +process, searchText).then(res => {
        setData (res)
    })
}

